package com.lagou.edu.controller;

import com.lagou.edu.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

@Slf4j
@RestController
@RequestMapping("/api/user/config")
@RefreshScope
public class ConfigController {

    // 1. 内存级别配置信息
    @Value("${lagou.message}")
    private String message;
    @Value("${mydb.url}")
    private String dburl;
    @Value("${lagou.mail.host}")
    private String host;


    @RequestMapping("/view")
    public String view() {
        return "dbUrl:" + dburl + ", message:" + message + ", mailHost:" + host;
    }
}
